[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CopyFile


Purpose   Copies a DOS file.

Decln.    CopyFile(Source, Target:string):byte

Returns   Byte

Remarks   Source and Target are the filenames. They may optionally include
          the drive and/or path. If the Target file already exists, it is
          overwritten.

          The return codes are

          0    Copy successful
          1    Source and target are the same
          2    Source file not found
          3    Unable to create Target file
          4    Data copy failed

Example

BEGIN
    IF COPYFILE('C:\AUTOEXEC.BAT','C:\AUTOEXEC.BAK') = 0 THEN
       WRITECENTER(1,WHITE,BLACK,'FILE SAVED')
    ELSE
       WRITECENTER(1,YELLOW,RED,'COPY FAILED');
END;

See Also: Exist
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson